﻿<html>

	<head>
		<title>店铺用户管理</title>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">

		<link href="../../css/skin/default/style.css" rel="stylesheet" type="text/css" />
		<link href="../../css/dialog.css" rel="stylesheet">
		<link href="../../js/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />

		<script src="../../js/lib/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>

		<script src="../../js/lib/ligerUI/js/plugins/ligerPopupEdit.js"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerForm.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerRadio.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTip.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerMenu.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerToolBar.js" type="text/javascript"></script>
		<script src="../../js/lib/jquery.form.js" type="text/javascript"></script>
		<script src="../../js/lib/json2.js" type="text/javascript"></script>
		<script src="../../js/dialog.js"></script>
		<script src="../../js/JS/layout.js"></script>
		<script src="../../js/constants.js" type="text/javascript"></script>
		<script src="../../js/api.js?v=01" type="text/javascript"></script>

		<script type="text/javascript">
			var manager;
			$(document).hover(parent.hindMenu);
			var mid = $api.getparastr("mid");
			var userUrl = BaseUrl + "AppUser?token=" + $api.getStorage("token");
			$(function() {
				$("form").ligerForm();
				toolbar();
				initData();
			});

			function initData() {
				var url = userUrl + "&key=&roleid=-1";
				manager = $("#maingrid4").ligerGrid({
					columns: [{
							display: '会员',
							name: 'FloginName',
							width: 220,
							align: 'left' 
						},
						{
							display: '姓名',
							name: 'Fname',
							width: 220,
							align: 'left' 
						},
						{
							display: '所属国别',
							name: 'Fnation',
							width: 110,
							align: 'center'
						},
						{
							display: '手机号码',
							name: 'Fmobile',
							width: 110,
							align: 'center'
						},
						{
							display: '角色类型',
							name: 'Froletype',
							width: 110,
							align: 'center',
							render: function(rowdata, rowindex, value) {
								if(rowdata.Froletype == 0) return "普通会员";
								else if(rowdata.Froletype == 1) return "代理商";
								return '促销员';
							}
						}, 
						{
							display: '推荐用户',
							name: 'Fpname',
							width: 130,
							align: 'center'
						},
						{
							display: '状态',
							name: 'Fstatus',
							width: 100,
							align: 'center',
							render: function(rowdata, rowindex, value) {
								if(rowdata.Fstatus == 1) return "正常";
								else if(rowdata.Fstatus == 2) return "被暂停";
							}
						}, {
							display: '最近登录时间',
							name: 'Flastlogindate',
							type: 'date',
							width: 100,
							render: function(rowdata, rowindex, value) {
								if($api.isEmpty(rowdata.Flastlogindate)) return "";
								return $api.formatCTime(rowdata.Flastlogindate);

							}
						},
						 {
							display: '登录次数',
							name: 'Floginnum', 
							width: 100 
						},
						{
							display: '注册时间',
							name: 'Fdate',
							type: 'date',
							minWidth: 200,
							render: function(rowdata, rowindex, value) {
								return $api.formatCTime(rowdata.Fdate);

							}
						}
					],
					dataAction: 'server',
					url: url,
					method: 'get',
					rowHeight: 100,
					width: '99.5%',
					height: '85%',
					usePager: true,
					isScroll: true,
					pageSize: 50
				});

			}

			function doSearch() {
				var key = $("#txtKeywords").val();
				var url = userUrl + "&roleid=-1&key=" + key;
				manager.GetDataByURL(url);

			}

			function toolbar() {
				$api.getLimit(mid, 0, function(data) {
					$("#icon-list").append(data);
				});
			}

			function edit() {

				var row = manager.getSelectedRow();
				if(row) {
					var url = "vsys/tb_sp_user/Edit.html?data=" + escape(JSON.stringify(row));

					parent.openCommWindow2(url, '用户设置', 400,320, function(res) {					 
							var url = BaseUrl + "spuser/set?token=" + $api.getStorage("token");
							$api.ajax2(url,  res  , function(data) {
								f_reload();
							});
					});
				} else {
					$.ligerDialog.warn("请选择行");
				}

			}

			function import2() {
				window.location.href = "import.html";
			}

			function export2() {
				window.location.href = encodeURI(BaseUrl + "SpUser?token=" + $api.getStorage("token"));
			}

			function f_reload() {
				doSearch();
			}
		</script>

	</head>

	<body class="mainbody">
		<form id="form1" onsubmit="return false">
			<div>
				<div style="display:none" class="div-alarm"></div>
				<div class="toolbar-wrap">
					<div class="toolbar">
						<div class="l-list">
							<ul id="icon-list" class="icon-list">

							</ul>
						</div>
						<div class="r-list">
							<input type="text" ID="txtKeywords" placeholder='用户名/手机号码' class="keyword" />
							<a class='btn-search' onclick='doSearch();' style="margin-right:10px;">搜索</a>

						</div>
					</div>
				</div>

				<div id="maingrid4" style="margin:0px;background:#fff;"></div>
				<div class="div-content" style="margin-top: 10px;width:99.5%">
					<div class="divhead">信息管理小贴士</div>
					<hr class="divline" />
					<div style="padding:1px 5px; line-height:22px;"><span style="font-weight:bold">注：</span>该会员为商铺所拥有的小程序会员用户数据。</div>

				</div>
		</form>

	</body>

</html>